<%--
    Document   : home
    Created on : Oct 23, 2011, 5:06:42 PM
    Author     : Group 106
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp"%>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.List" %>
<%@page import="com.aptech.model.RealEstateType" %>
<%@page import="com.aptech.model.User" %>
<%@page import="com.aptech.model.realEstateInfo" %>
<%@page import="com.aptech.DAO.realEstateTypeDAO" %>
<%@page import="com.aptech.DAO.realEstateDAO" %>

<%@ taglib prefix="page" uri="/WEB-INF/tlds/phantrang.tld" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script language="javascript">

    function checkInputData()
    {
        if(document.frmPayingCash.cashSeries.value == ""){
            alert("You must input cash Series!");
            document.frmPayingCash.cashSeries.focus();
            return false;
        }
        return true;
    }
</script>
<html>
    <head>
        <link rel="stylesheet" href="CSS/css.css" />
        <link rel="stylesheet" href="CSS/msh_style.css"/>
        <link rel="stylesheet" href="CSS/gallery_style.css"/>
        <!--<link rel="stylesheet" href="CSS/css_header.css" /> -->
        <link rel="stylesheet" href="CSS/mn_left.css" />
        <link rel="stylesheet" href="CSS/mn_search.css" />
        <link rel="stylesheet" href="CSS/css_realEstateInfor.css" />
        <link rel="stylesheet" href="CSS/css_footer.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <%
                User objUser = null;
                String userID = "";
                ArrayList<RealEstateType> listRealStateType = new ArrayList<RealEstateType>();
                realEstateTypeDAO objRealEstateTypeDAO;
                if (request.getSession().getAttribute("user") != null) {
                    objRealEstateTypeDAO = new realEstateTypeDAO();
                    objUser = (User) request.getSession().getAttribute("user");
                    userID = objUser.getUserID() + "";
                    listRealStateType = new ArrayList<RealEstateType>();
                    listRealStateType = objRealEstateTypeDAO.getAllRealEstateType();
    %>
    <body>

        <div id="wrap">
            <%@include file="header.jsp" %>

            <div class="clear"></div><!--End .clear-->
            <div id="main">
                <div id="left_sidebar">
                    <div id="houseType">
                        <div class="mn_header_left"></div>
                        <div class="mn_header_center">Information</div>
                        <div class="mn_header_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="profile.jsp">Profile</a> </div>
                        <div class="mn_content_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="cashManagement.jsp">Account</a></div>
                        <div class="mn_content_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="changePassword.jsp">Change Password</a>
                        </div>
                        <div class="mn_content_right"></div>
                        <div class="mn_footer_left"></div>
                        <div class="mn_footer_content"></div>
                        <div class="mn_footer_right"></div>
                    </div><!--End #houseType-->
                </div><!--End #left_sidebar-->
                <div id="content">
                    <table width="700" border="0">
                         <tr>
                             <td align="center">
                     <%
                       if(request.getSession().getAttribute("failed") != null)
                        {
                     %>
                        <table width="400" align="center" height="300">
                            <tr>
                                <td align="center">
                                    Load Card False!
                                    <br/>
                                    <br/>
                                    <br/>
                                    <a href="payingCash.jsp"> Click Here </a> To Back Paying Cash Or <a href="index.jsp"> Click Here </a> To Go To Home
                                </td>
                            </tr>
                        </table>
                    <%
                        }else{
                    %>
                    <form action="payingCash.do" method="post" id="frmPayingCash" name="frmPayingCash" class="frmPayingCash" onsubmit="return checkInputData()">
                        <table width="400" align="center" height="200" border="2">
                            <tr>
                                <td align="center">
                                    <%
                                        if(request.getSession().getAttribute("exist") != null)
                                        {
                                            String seNum = request.getSession().getAttribute("exist")+"";
                                    %>
                                    <p style="color:#FF0000"> ID Card Is Incorrect Or Has Been Used</p>
                                    <br/><br/><br/>
                                    Series Number: <input type="text" name="cashSeries" id="cashSeries" size="20" value="<%=seNum%>" onclick="value=''"/>
                                    <%
                                        } else{
                                    %>
                                    Series Number: <input type="text" name="cashSeries" id="cashSeries" size="20"/>
                                    <%
                                        }
                                    %>
                                    <br/><br/><br/>
                                    <input type="submit" value="    Load Card    " name="btnLapThe" />
                                </td>
                            </tr>
                        </table>
                    </form>

                   <%
                    }
                    %>
</td>
                         </tr>
                     </table>
                </div><!--End #content-->
            </div><!--End #main-->
            <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
            <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
            <div id="msh_footer_panel" style="width: 942px;">
    Copyright © 2011 <a href="aptech.vn">Ha Noi - Aptech</a> | <a href="home.jsp" target="_parent">Website My Sweet Home</a> by <a href="home.jsp" target="_blank">Group 106</a>
            </div>
        </div><!--End #wrap-->
        <div class="clear"></div><!--End .clear-->
    </body>
    <%
                } else {
                    response.sendRedirect("login.jsp");
                }
    %>
</html>